#include <iostream>
#include <vector>
using namespace std;

int main()
{
    int n;
    cin >> n;

    vector<int> prevnum(n);
    prevnum[0] = 1;
    printf("%5d\n", prevnum[0]);

    int j = 1;
    while (n-- > 1)
    {
        for (int i = j; i > 0; i--)
            prevnum[i] += prevnum[i - 1];
        j++;

        for (int i = 0; i < j; i++)
            printf("%5d", prevnum[i]);
        cout << endl;
    }
}
#include <iostream>
#include <vector>
using namespace std;

int main()
{
    int n;
    cin >> n;

    vector<int> prevnum(n);
    prevnum[0] = 1;
    printf("%5d\n", prevnum[0]);

    int j = 1;
    while (n-- > 1)
    {
        for (int i = j; i > 0; i--)
            prevnum[i] += prevnum[i - 1];
        j++;

        for (int i = 0; i < j; i++)
            printf("%5d", prevnum[i]);
        cout << endl;
    }
}
